3.12.21 \(\int \frac {a+i a \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx\) [1121]

Optimal. Leaf size=46 \[ -\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f} \]

[Out]

-2*I*a*arctanh((c+d*tan(f*x+e))^(1/2)/(c-I*d)^(1/2))/f/(c-I*d)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3618, 65, 214} \begin {gather*} -\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f \sqrt {c-i d}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])/Sqrt[c + d*Tan[e + f*x]],x]

[Out]

((-2*I)*a*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c - I*d]])/(Sqrt[c - I*d]*f)

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3618

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c*(
d/f), Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rubi steps

\begin {align*} \int \frac {a+i a \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx &=\frac {\left (i a^2\right ) \text {Subst}\left (\int \frac {1}{\left (-a^2+a x\right ) \sqrt {c-\frac {i d x}{a}}} \, dx,x,i a \tan (e+f x)\right )}{f}\\ &=-\frac {\left (2 a^3\right ) \text {Subst}\left (\int \frac {1}{-a^2-\frac {i a^2 c}{d}+\frac {i a^2 x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{d f}\\ &=-\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.10, size = 71, normalized size = 1.54 \begin {gather*} -\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}}{\sqrt {c-i d}}\right )}{\sqrt {c-i d} f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])/Sqrt[c + d*Tan[e + f*x]],x]

[Out]

((-2*I)*a*ArcTanh[Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))]/Sqrt[c - I*d]])/(Sqrt[c
 - I*d]*f)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 732 vs. \(2 (37 ) = 74\).
time = 0.36, size = 733, normalized size = 15.93

method result size
derivativedivides \(\frac {a \left (\frac {\frac {\left (-i \sqrt {c^{2}+d^{2}}-i c +d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -\frac {\left (-i \sqrt {c^{2}+d^{2}}-i c +d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}}+\frac {\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \ln \left (d \tan \left (f x +e \right )+c -\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{3}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c \,d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2} d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{3}+\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}-\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, \left (\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}\right )}\right )}{f}\) \(733\)
default \(\frac {a \left (\frac {\frac {\left (-i \sqrt {c^{2}+d^{2}}-i c +d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -\frac {\left (-i \sqrt {c^{2}+d^{2}}-i c +d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}}+\frac {\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \ln \left (d \tan \left (f x +e \right )+c -\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{3}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c \,d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2} d +\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{3}+\frac {\left (2 i c^{2} \sqrt {c^{2}+d^{2}}+i d^{2} \sqrt {c^{2}+d^{2}}+2 i c^{3}+2 i c \,d^{2}-c d \sqrt {c^{2}+d^{2}}-c^{2} d -d^{3}\right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}-\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, \sqrt {c^{2}+d^{2}}\, \left (\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}\right )}\right )}{f}\) \(733\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/f*a*(1/(2*(c^2+d^2)^(1/2)+2*c)^(1/2)/(c^2+d^2)^(1/2)*(1/2*(-I*(c^2+d^2)^(1/2)-I*c+d)*ln(d*tan(f*x+e)+c+(c+d*
tan(f*x+e))^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))+2*(-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c+(2*(c^2
+d^2)^(1/2)+2*c)^(1/2)*d-1/2*(-I*(c^2+d^2)^(1/2)-I*c+d)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)
^(1/2)*arctan((2*(c+d*tan(f*x+e))^(1/2)+(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2)))+1/(2*(c
^2+d^2)^(1/2)+2*c)^(1/2)/(c^2+d^2)^(1/2)/((c^2+d^2)^(1/2)*c+c^2+d^2)*(1/2*(2*I*(c^2+d^2)^(1/2)*c^2+I*d^2*(c^2+
d^2)^(1/2)+2*I*c^3+2*I*c*d^2-c*d*(c^2+d^2)^(1/2)-c^2*d-d^3)*ln(d*tan(f*x+e)+c-(c+d*tan(f*x+e))^(1/2)*(2*(c^2+d
^2)^(1/2)+2*c)^(1/2)+(c^2+d^2)^(1/2))+2*(-I*(c^2+d^2)^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c^2-I*(2*(c^2+d^2)^(
1/2)+2*c)^(1/2)*c^3-I*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c*d^2+(c^2+d^2)^(1/2)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*c*d+(2
*(c^2+d^2)^(1/2)+2*c)^(1/2)*c^2*d+(2*(c^2+d^2)^(1/2)+2*c)^(1/2)*d^3+1/2*(2*I*(c^2+d^2)^(1/2)*c^2+I*d^2*(c^2+d^
2)^(1/2)+2*I*c^3+2*I*c*d^2-c*d*(c^2+d^2)^(1/2)-c^2*d-d^3)*(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*
c)^(1/2)*arctan((2*(c+d*tan(f*x+e))^(1/2)-(2*(c^2+d^2)^(1/2)+2*c)^(1/2))/(2*(c^2+d^2)^(1/2)-2*c)^(1/2))))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 6772 vs. \(2 (35) = 70\).
time = 0.70, size = 6772, normalized size = 147.22 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-1/4*(sqrt(2*c^2 + 2*d^2)*(2*a*arctan2((d^2*cos(2*f*x + 2*e) - c*d*sin(2*f*x + 2*e) + ((c^4 + 2*c^2*d^2 + d^4)
*cos(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^4)*sin(2*f*x + 2*e)^4 + c^4 + 2*c^2*d^2 + d^4 + 4*(c^4 + c^2*d^2)*c
os(2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2*f*x + 2*e)^3 + 2*(3*c^4 + 2*c^2*d^2 - d^4)*cos(2*f*x + 2*e)^2 + 2*
(c^4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + c^2*d^2)*cos(2*f*x + 2*e))*sin(
2*f*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e) + 4*(c^3*d + c*d^3 + (c^3*d + c*d^3)*cos(2*f*x + 2*e)^2 +
2*(c^3*d + c*d^3)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))^(1/4)*d*sin(1/2*arctan2(-2*(c*d*cos(2*f*x + 2*e)^2 - c*d
*sin(2*f*x + 2*e)^2 + c*d*cos(2*f*x + 2*e) - (c^2 + (c^2 - d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))/d^2, (2*c^
2*cos(2*f*x + 2*e) + (c^2 - d^2)*cos(2*f*x + 2*e)^2 - (c^2 - d^2)*sin(2*f*x + 2*e)^2 + c^2 + d^2 + 2*(2*c*d*co
s(2*f*x + 2*e) + c*d)*sin(2*f*x + 2*e))/d^2)))/d^2, -(c*cos(2*f*x + 2*e) + d*sin(2*f*x + 2*e) - ((c^4 + 2*c^2*
d^2 + d^4)*cos(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^4)*sin(2*f*x + 2*e)^4 + c^4 + 2*c^2*d^2 + d^4 + 4*(c^4 +
c^2*d^2)*cos(2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2*f*x + 2*e)^3 + 2*(3*c^4 + 2*c^2*d^2 - d^4)*cos(2*f*x + 2
*e)^2 + 2*(c^4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + c^2*d^2)*cos(2*f*x +
2*e))*sin(2*f*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e) + 4*(c^3*d + c*d^3 + (c^3*d + c*d^3)*cos(2*f*x +
 2*e)^2 + 2*(c^3*d + c*d^3)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))^(1/4)*cos(1/2*arctan2(-2*(c*d*cos(2*f*x + 2*e)
^2 - c*d*sin(2*f*x + 2*e)^2 + c*d*cos(2*f*x + 2*e) - (c^2 + (c^2 - d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))/d^
2, (2*c^2*cos(2*f*x + 2*e) + (c^2 - d^2)*cos(2*f*x + 2*e)^2 - (c^2 - d^2)*sin(2*f*x + 2*e)^2 + c^2 + d^2 + 2*(
2*c*d*cos(2*f*x + 2*e) + c*d)*sin(2*f*x + 2*e))/d^2)) + c)/d) - I*a*log((2*c^2*cos(2*f*x + 2*e) + (c^2 + d^2)*
cos(2*f*x + 2*e)^2 + 2*c*d*sin(2*f*x + 2*e) + (c^2 + d^2)*sin(2*f*x + 2*e)^2 + sqrt((c^4 + 2*c^2*d^2 + d^4)*co
s(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^4)*sin(2*f*x + 2*e)^4 + c^4 + 2*c^2*d^2 + d^4 + 4*(c^4 + c^2*d^2)*cos(
2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2*f*x + 2*e)^3 + 2*(3*c^4 + 2*c^2*d^2 - d^4)*cos(2*f*x + 2*e)^2 + 2*(c^
4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + c^2*d^2)*cos(2*f*x + 2*e))*sin(2*f
*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e) + 4*(c^3*d + c*d^3 + (c^3*d + c*d^3)*cos(2*f*x + 2*e)^2 + 2*(
c^3*d + c*d^3)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))*cos(1/2*arctan2(-2*(c*d*cos(2*f*x + 2*e)^2 - c*d*sin(2*f*x
+ 2*e)^2 + c*d*cos(2*f*x + 2*e) - (c^2 + (c^2 - d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))/d^2, (2*c^2*cos(2*f*x
 + 2*e) + (c^2 - d^2)*cos(2*f*x + 2*e)^2 - (c^2 - d^2)*sin(2*f*x + 2*e)^2 + c^2 + d^2 + 2*(2*c*d*cos(2*f*x + 2
*e) + c*d)*sin(2*f*x + 2*e))/d^2))^2 + sqrt((c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^
4)*sin(2*f*x + 2*e)^4 + c^4 + 2*c^2*d^2 + d^4 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2
*f*x + 2*e)^3 + 2*(3*c^4 + 2*c^2*d^2 - d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 +
 d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + c^2*d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*
x + 2*e) + 4*(c^3*d + c*d^3 + (c^3*d + c*d^3)*cos(2*f*x + 2*e)^2 + 2*(c^3*d + c*d^3)*cos(2*f*x + 2*e))*sin(2*f
*x + 2*e))*sin(1/2*arctan2(-2*(c*d*cos(2*f*x + 2*e)^2 - c*d*sin(2*f*x + 2*e)^2 + c*d*cos(2*f*x + 2*e) - (c^2 +
 (c^2 - d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))/d^2, (2*c^2*cos(2*f*x + 2*e) + (c^2 - d^2)*cos(2*f*x + 2*e)^2
 - (c^2 - d^2)*sin(2*f*x + 2*e)^2 + c^2 + d^2 + 2*(2*c*d*cos(2*f*x + 2*e) + c*d)*sin(2*f*x + 2*e))/d^2))^2 + c
^2 - 2*((c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^4)*sin(2*f*x + 2*e)^4 + c^4 + 2*c^2*
d^2 + d^4 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2*f*x + 2*e)^3 + 2*(3*c^4 + 2*c^2*d^2
 - d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 +
c^2*d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e) + 4*(c^3*d + c*d^3 + (c^3*d
 + c*d^3)*cos(2*f*x + 2*e)^2 + 2*(c^3*d + c*d^3)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))^(1/4)*(c*d*cos(2*f*x + 2*
e) + d^2*sin(2*f*x + 2*e) + c*d)*cos(1/2*arctan2(-2*(c*d*cos(2*f*x + 2*e)^2 - c*d*sin(2*f*x + 2*e)^2 + c*d*cos
(2*f*x + 2*e) - (c^2 + (c^2 - d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e))/d^2, (2*c^2*cos(2*f*x + 2*e) + (c^2 - d
^2)*cos(2*f*x + 2*e)^2 - (c^2 - d^2)*sin(2*f*x + 2*e)^2 + c^2 + d^2 + 2*(2*c*d*cos(2*f*x + 2*e) + c*d)*sin(2*f
*x + 2*e))/d^2))/d + 2*((c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*e)^4 + (c^4 + 2*c^2*d^2 + d^4)*sin(2*f*x + 2*e)^
4 + c^4 + 2*c^2*d^2 + d^4 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e)^3 + 4*(c^3*d + c*d^3)*sin(2*f*x + 2*e)^3 + 2*(3
*c^4 + 2*c^2*d^2 - d^4)*cos(2*f*x + 2*e)^2 + 2*(c^4 + 2*c^2*d^2 + d^4 + (c^4 + 2*c^2*d^2 + d^4)*cos(2*f*x + 2*
e)^2 + 2*(c^4 + c^2*d^2)*cos(2*f*x + 2*e))*sin(2*f*x + 2*e)^2 + 4*(c^4 + c^2*d^2)*cos(2*f*x + 2*e) + 4*(c^3*d
+ c*d^3 + (c^3*d + c*d^3)*cos(2*f*x + 2*e)^2 + ...

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 285 vs. \(2 (35) = 70\).
time = 0.81, size = 285, normalized size = 6.20 \begin {gather*} \frac {1}{4} \, \sqrt {-\frac {4 i \, a^{2}}{{\left (i \, c + d\right )} f^{2}}} \log \left (\frac {{\left (2 \, a c + {\left ({\left (i \, c + d\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, c + d\right )} f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {4 i \, a^{2}}{{\left (i \, c + d\right )} f^{2}}} + 2 \, {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) - \frac {1}{4} \, \sqrt {-\frac {4 i \, a^{2}}{{\left (i \, c + d\right )} f^{2}}} \log \left (\frac {{\left (2 \, a c + {\left ({\left (-i \, c - d\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, c - d\right )} f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {4 i \, a^{2}}{{\left (i \, c + d\right )} f^{2}}} + 2 \, {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/4*sqrt(-4*I*a^2/((I*c + d)*f^2))*log((2*a*c + ((I*c + d)*f*e^(2*I*f*x + 2*I*e) + (I*c + d)*f)*sqrt(((c - I*d
)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(-4*I*a^2/((I*c + d)*f^2)) + 2*(a*c - I*a*d)*e
^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/a) - 1/4*sqrt(-4*I*a^2/((I*c + d)*f^2))*log((2*a*c + ((-I*c - d)*f*e^
(2*I*f*x + 2*I*e) + (-I*c - d)*f)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sq
rt(-4*I*a^2/((I*c + d)*f^2)) + 2*(a*c - I*a*d)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/a)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} i a \left (\int \left (- \frac {i}{\sqrt {c + d \tan {\left (e + f x \right )}}}\right )\, dx + \int \frac {\tan {\left (e + f x \right )}}{\sqrt {c + d \tan {\left (e + f x \right )}}}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))**(1/2),x)

[Out]

I*a*(Integral(-I/sqrt(c + d*tan(e + f*x)), x) + Integral(tan(e + f*x)/sqrt(c + d*tan(e + f*x)), x))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 156 vs. \(2 (35) = 70\).
time = 0.51, size = 156, normalized size = 3.39 \begin {gather*} \frac {4 \, a \arctan \left (-\frac {2 \, {\left (i \, \sqrt {d \tan \left (f x + e\right ) + c} c + i \, \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{\sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} c - i \, \sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d + \sqrt {c^{2} + d^{2}} \sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{\sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c + \sqrt {c^{2} + d^{2}}} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^(1/2),x, algorithm="giac")

[Out]

4*a*arctan(-2*(I*sqrt(d*tan(f*x + e) + c)*c + I*sqrt(c^2 + d^2)*sqrt(d*tan(f*x + e) + c))/(sqrt(2*c + 2*sqrt(c
^2 + d^2))*c - I*sqrt(2*c + 2*sqrt(c^2 + d^2))*d + sqrt(c^2 + d^2)*sqrt(2*c + 2*sqrt(c^2 + d^2))))/(sqrt(2*c +
 2*sqrt(c^2 + d^2))*f*(-I*d/(c + sqrt(c^2 + d^2)) + 1))

________________________________________________________________________________________

Mupad [B]
time = 6.40, size = 2947, normalized size = 64.07 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)/(c + d*tan(e + f*x))^(1/2),x)

[Out]

2*atanh((8*c*d^2*(- (-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1
/2)*(c + d*tan(e + f*x))^(1/2)*(-16*a^4*d^2*f^4)^(1/2))/((16*a^3*c*d^5*f^5)/(c^2*f^4 + d^2*f^4) + (4*a*d^5*f^4
*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5) + (16*a^3*c^3*d^3*f^5)/(c^2*f^4 + d^2*f^4) + (4*a*c^2*d^3*f^4*(-
16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5)) - (32*a^2*d^2*(- (-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4))
- (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((16*a^3*c*d^3*f^3)/(c^2*f^4 + d^2*f^
4) + (4*a*d^3*f^2*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5)) + (32*a^2*c^2*d^2*f^2*(- (-16*a^4*d^2*f^4)^(1/
2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((16*a^3*
c*d^5*f^5)/(c^2*f^4 + d^2*f^4) + (4*a*d^5*f^4*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5) + (16*a^3*c^3*d^3*f
^5)/(c^2*f^4 + d^2*f^4) + (4*a*c^2*d^3*f^4*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5)))*(- (-16*a^4*d^2*f^4)
^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2) - 2*atanh((32*a^2*d^2*((-16*a^4*d
^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2)
)/((16*a^3*c*d^3*f^3)/(c^2*f^4 + d^2*f^4) - (4*a*d^3*f^2*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5)) + (8*c*
d^2*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(
e + f*x))^(1/2)*(-16*a^4*d^2*f^4)^(1/2))/((16*a^3*c*d^5*f^5)/(c^2*f^4 + d^2*f^4) - (4*a*d^5*f^4*(-16*a^4*d^2*f
^4)^(1/2))/(c^2*f^5 + d^2*f^5) + (16*a^3*c^3*d^3*f^5)/(c^2*f^4 + d^2*f^4) - (4*a*c^2*d^3*f^4*(-16*a^4*d^2*f^4)
^(1/2))/(c^2*f^5 + d^2*f^5)) - (32*a^2*c^2*d^2*f^2*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*
f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((16*a^3*c*d^5*f^5)/(c^2*f^4 + d^2*f^4) - (4*a
*d^5*f^4*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5) + (16*a^3*c^3*d^3*f^5)/(c^2*f^4 + d^2*f^4) - (4*a*c^2*d^
3*f^4*(-16*a^4*d^2*f^4)^(1/2))/(c^2*f^5 + d^2*f^5)))*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*
c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2) - 2*atanh((8*c*d^2*(- (-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) -
 (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-16*a^4*d^2*f^4)^(1/2))/((a^3*c^2*d^4*
f^5*16i)/(c^2*f^4 + d^2*f^4) - a^3*c^2*d^2*f*16i - a^3*d^4*f*16i + (a^3*c^4*d^2*f^5*16i)/(c^2*f^4 + d^2*f^4) +
 (a*c*d^4*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5) + (a*c^3*d^2*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^
2*f^5 + d^2*f^5)) - (32*a^2*d^2*(- (-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4
+ d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((a^3*c^2*d^2*f^3*16i)/(c^2*f^4 + d^2*f^4) - (a^3*d^2*16i)/f +
(a*c*d^2*f^2*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5)) + (32*a^2*c^2*d^2*f^2*(- (-16*a^4*d^2*f^4)^(1/2)
/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((a^3*c^2*d
^4*f^5*16i)/(c^2*f^4 + d^2*f^4) - a^3*c^2*d^2*f*16i - a^3*d^4*f*16i + (a^3*c^4*d^2*f^5*16i)/(c^2*f^4 + d^2*f^4
) + (a*c*d^4*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5) + (a*c^3*d^2*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/
(c^2*f^5 + d^2*f^5)))*(- (-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)
))^(1/2) - 2*atanh((32*a^2*d^2*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d
^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/((a^3*d^2*16i)/f - (a^3*c^2*d^2*f^3*16i)/(c^2*f^4 + d^2*f^4) + (a*
c*d^2*f^2*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5)) + (8*c*d^2*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 +
d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2)*(-16*a^4*d^2*f^4)^(1/2))/(a^
3*d^4*f*16i + a^3*c^2*d^2*f*16i - (a^3*c^2*d^4*f^5*16i)/(c^2*f^4 + d^2*f^4) - (a^3*c^4*d^2*f^5*16i)/(c^2*f^4 +
 d^2*f^4) + (a*c*d^4*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5) + (a*c^3*d^2*f^4*(-16*a^4*d^2*f^4)^(1
/2)*4i)/(c^2*f^5 + d^2*f^5)) - (32*a^2*c^2*d^2*f^2*((-16*a^4*d^2*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*
f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)*(c + d*tan(e + f*x))^(1/2))/(a^3*d^4*f*16i + a^3*c^2*d^2*f*16i - (a^3*c^2*
d^4*f^5*16i)/(c^2*f^4 + d^2*f^4) - (a^3*c^4*d^2*f^5*16i)/(c^2*f^4 + d^2*f^4) + (a*c*d^4*f^4*(-16*a^4*d^2*f^4)^
(1/2)*4i)/(c^2*f^5 + d^2*f^5) + (a*c^3*d^2*f^4*(-16*a^4*d^2*f^4)^(1/2)*4i)/(c^2*f^5 + d^2*f^5)))*((-16*a^4*d^2
*f^4)^(1/2)/(16*(c^2*f^4 + d^2*f^4)) - (a^2*c*f^2)/(4*(c^2*f^4 + d^2*f^4)))^(1/2)

________________________________________________________________________________________